<?php
/**
 * 默认展示页面
 *
 *
 *
 * @copyright  Copyright (c) 2014-2015 TuntronKJ Inc. (http://www.tuntron.com)
 * @license    http://www.tuntron.com
 * @link       http://www.tuntron.com
 * @since      File available since Release v1.1
 */
defined('InTuntronKJ') or exit('Access Invalid!');
class gamerecordControl extends BaseLotteryHallControl{
	public function indexOp(){
		
		$user_model = Model('member');
		$uid = $_SESSION['uid'];
				
		$page = $_GET['pageIndex'];
		if(!$page){
			$page = 1;
		}
		$start = 10*$page-10;
		
		$memberinfo = $user_model->getMemberInfo(array('uid'=>$uid));
		
		$user_list = $user_model->getMemberList(array('parentId'=>$uid),'','',$start.',10','uid asc');				
		$user_count = $user_model->getMemberCount(array('parentId'=>$uid));

		if($user_count%10 == 0){
			$totalpage = $user_count/10;
		}else{
			$totalpage = intval($user_count/10)+1;
		}

		$param = array();
		$param['beginDate'] = date('Y-m-d',strtotime('-30 day'));
		$param['endDate'] = date("Y-m-d");
		$param['username'] = $memberinfo['username'];
		
		Tpl::output('user_list',$user_list); 
		Tpl::output('param',$param);
		Tpl::output('page',$page);
		Tpl::output('totalpage',$totalpage);
		Tpl::output('count',count($user_list));
		Tpl::showpage('gamerecord');
	}



}
